/**
 * Created by ls.c on 2016/11/3.
 */

export const FETCH_TOKEN = 'FETCH_TOKEN'
export const FETCH_BAR_ACTIVE = 'FETCH_BAR_ACTIVE'
export const FETCH_MID = 'FETCH_MID'
export const FETCH_ME_INFO = 'FETCH_ME_INFO'
export const FETCH_POINTS_DATA = 'FETCH_POINTS_DATA'
export const FETCH_HOME_UNREAD = 'FETCH_HOME_UNREAD'
export const FETCH_SEEK_UNREAD = 'FETCH_SEEK_UNREAD'
export const FETCH_ME_UNREAD = 'FETCH_ME_UNREAD'
export const FETCH_TAB_UNREAD = 'FETCH_TAB_UNREAD'
export const FETCH_MSG_INFO = 'FETCH_MSG_INFO'


const mutations = {

  // token
  [FETCH_TOKEN] (state, data) {
    state.tokens = data
  },
  // 获取底部激活信息
  [FETCH_BAR_ACTIVE] (state, data) {
    state.barActive = data
  },
  // 获取会员ID（患者ID）
  [FETCH_MID] (state, data) {
    state.mid = data
  },
  // 获取会员信息
  [FETCH_ME_INFO] (state, data) {
    state.meInfo = data
  },
  // 获取积分
  [FETCH_POINTS_DATA] (state, data) {
    state.pointsData = data
  },
  // 首页底部红点
  [FETCH_HOME_UNREAD] (state, data) {
    state.homeUnread = data
  },
  // 问医底部红点
  [FETCH_SEEK_UNREAD] (state, data) {
    state.seekUnread = data
  },
  // 个人中心底部红点
  [FETCH_ME_UNREAD] (state, data) {
    state.meUnread = data
  },
  // TAB红点
  [FETCH_TAB_UNREAD] (state, data) {
    state.tabUnread = data
  },
  // 消息相关
  [FETCH_MSG_INFO] (state, data) {
    state.msgInfo = data
  }
}

export default mutations
